<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>


    <script type="text/javascript" src="File.js" charset="UTF-8"></script>
    <script type="text/javascript" src="RandomAcessInputStream.js" charset="UTF-8"></script>
    <script type="text/javascript" src="WASDecoder.js" charset="UTF-8"></script>
    <script type="text/javascript" src="WASFrame.js" charset="UTF-8"></script>
    <script type="text/javascript" src="BufferedImage.js" charset="UTF-8"></script>
    <script type="text/javascript" src="BytesArrayUtil.js" charset="UTF-8"></script>

</head>
<body>
<div id="main"></div>
jsReadFile:
<input type="file" onchange="jsReadFiles(this.files)"/>
</body>
</body>
<script type="text/javascript">



    //js 读取文件
    function jsReadFiles(files) {
        if (files.length) {
            deleteCxt2d();
            new  FileSync(files).loadFileAll(UIload)

        }
    }
    function deleteCxt2d() {
let elem =document.getElementById("main")


        while(elem.hasChildNodes()) //当elem下还存在子节点时 循环继续
        { 
            elem.removeChild(elem.firstChild);
        }

    }

    function  log(e) {
        console.log(e)
    }
    function UIload(data) {

        let was= new WASDecoder();
        was.load(data);

        for(let idx in  was.getFrames()){

            let image=was.getFrame(idx);

        }


    }


</script>
</html>